﻿using System;
using System.Globalization;
using System.Windows.Data;
using Vra.Components.Models.Menu;

namespace Vra.Components.Converters
{
	public class TypeToObjectConverter : IValueConverter
	{
		public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
		{
			var item = value as MenuItem;
			return item != null ? Activator.CreateInstance(item.ViewType) : null;
		}

		public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
		{
			throw new NotImplementedException();
		}
	}
}
